<template>
  <div>
    <input type="text" v-model="kw">
    <good-list :arr="arr"></good-list>
  </div>
</template>

<script>
import {reqSearch} from "../../http/http";
export default {
  data(){
    return {
      kw:"",
      arr:[]
    };
  },
  watch:{
    kw(){
      if(this.kw === ""){
        this.arr = [];
        return;
      }

      reqSearch(this.kw).then(res=>{
        // console.log(res);
          this.arr = res.data.list ? res.data.list:[] 
      })
    }
  }
}
</script>

<style>

</style>